import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class File_rw {
   public String readToString(String filepath) throws IOException {
	   File file =new File(filepath);
	   FileInputStream files=new FileInputStream(file);
		Long filelength =file.length();
		byte[] by =new byte[filelength.intValue()];
		StringBuffer buf = new StringBuffer();
	   if(file.isFile()&&file.exists()) {
		   
		
			if(files.read(by)!=-1) {
				buf.append(new String(by));
			}
			   
	   }files.close();
	  return buf.toString();
   }
}
